perm filename INTOPS.PAL[AL,HE]20 blob
sn#417600 filedate 1979-02-08 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 .SBTTL Table of interpreter instructions
C00017 ENDMK
C⊗;
.SBTTL Table of interpreter instructions
COMMENT ⊗
This table is parallel to the file INTDEF.SAI[AL,HE]. It is required
at several places in the interpreter; each of these can define the
macro MAKEOP however desired. The convention here for types of
arguments that each pseudo-op takes is this:
a absolute address
la list of absolute addresses
o offset or level-offset pair
lo list of offsets or level-offset pairs
n,t small constants
r50 word of radix 50
r used in POINTY, for relative address offset in words from curr
position
NOTE: File INTARG.PAL[AL,HE] (used in ALAID) is also parallel to this file and
should be changed accordingly when this file changes.
⊗
PCVERSION == 8 ;Fix this every time you add some new pcodes
II == 2 ;Start of interpreter jump table (0 is illegal instruction)
;Motion control
MAKEOP XMOVE,MOVE,<a,n> ;Prepare, execute move whose traj table is at a.
MAKEOP XCENTER,CENTER,<a,n>, ;Center using traj table at a. Using mech n.
MAKEOP XSTOP,STOP,<n> ;Cause all mechanisms whose bits are on in n to stop.
MAKEOP XTFRCST,TFRCST,<n> ;Initializes force system, force frame on stack
; control bits in <n>
MAKEOP XVMKFRC,VMKFRC ;Gets vector off stack, makes a force frame along vector
; and puts it on the stack
MAKEOP XCOMPLY,COMPLY,<n> ;Sets up compliant motion in next move
;Gets force magnitude off stack, control bits in <n>
MAKEOP XCMPOFF,CMPOFF,<n> ;Turns off compliant motion in current move (not used)
MAKEOP XNOTICE,NOTICE ;Make sure everyone knows where the arm is.
MAKEOP XFILL0,NOOP ;filler
;Variables
MAKEOP XMVAR,MVAR,<<t,n,...>> ;Make n variables of type t with possible
; optional arguments (list arg)
MAKEOP XKVAR,KVAR,n ;Kill last n environment entries
;Stack operations
MAKEOP XGTVAL,GTVAL,<o>;Push value of arg (level-offset pair).
MAKEOP XCHNGE,CHNGE,<o>;Pop value into arg (level-offset pair).
MAKEOP XPUSH, PUSHV,<a> ;Push arg directly (as a ptr) onto stack. For cnstnts.
MAKEOP XPOP, POPV ;Pop stack.
MAKEOP XCOPY, COPY ,<n>;Copy n'th down to top of stack.
MAKEOP XREPLAC,REPLAC,<n> ;Replace n'th down with top (which pop)
;Flow of control
MAKEOP XJUMP, JUMP, <a> ;Jump to address
MAKEOP XJUMPC,JUMPC,<a> ;Jump to address if "true"
MAKEOP XTERMINATE,TERMINATE ;Terminate this interpreter
MAKEOP XPROC, PROC,<a,lo> ;Call a procedure at a, with arg list lo
MAKEOP XRETURN,RETURN,<n> ;Return from procedure
MAKEOP XSPROUT,SPROUT,la ;Sprout interpreters at each arg, wait (list arg)
MAKEOP XFORCHK,FORCHK,<a> ;Do a FOR-loop check, and fail to location d.
;MAKEOP XFOREND,FOREND,<a> ;Increment FOR variable and jump to FORCHK at a
MAKEOP XCASE,CASE,<n,la> ;Does a regular case statement dispatch
MAKEOP XSIGNAL,SIGNAL,<o> ;Signal event at level-offset o.
MAKEOP XWAITE,WAITE,<o> ;Wait on event at level-offset o.
MAKEOP XPAUSE,PAUSE ;Pause in seconds (on stack)
MAKEOP XABORT,ABORT ;Abort current motions
MAKEOP XDDT,GODDT ;go to DDT.
MAKEOP XFILL1,NOOP ;filler
MAKEOP XPUSHSCI, PUSHSCI ;Push floating point scalar immediate ***
MAKEOP XINT,INT ;s ← INT s (integer part of) ***
;Affixment
MAKEOP XAFFIX,AFFIX,<o,o',n (,o")> ;Makes an affixement of type n between two
; frames at level-offsets o & o' (trans at o")
MAKEOP XUNFIX,UNFIX,<o,o'> ;Unfixes the two frames at level-offsets: o & o"
;Boolean
MAKEOP XSLE,SLE ;S≤S compare top two elts, pop, pop, push answer
MAKEOP XSLT,SLT ;S<S true := 1.0
MAKEOP XSGE,SGE ;S≥S false:= 0
MAKEOP XSGT,SGT ;S>S
MAKEOP XSEQ,SEQ ;S=S
MAKEOP XSNE,SNE ;S≠S
MAKEOP XAND,AND ;S∧S (logical and)
MAKEOP XLOR,LOR ;S∨S (logical or)
MAKEOP XNOT,NOT ;¬S (logical not) note: this only takes one arg
MAKEOP XXOR,LXOR ;S⊗S (logical exclusive or)
MAKEOP XEQV,EQV ;S≡S (logical equivalence)
;Arithmetic
MAKEOP XWHERE,WHERE,<n> ;Push the current location of mechanism n
MAKEOP XSADD, SADD ;S+S: Add top two elts, pop, pop, push answer
MAKEOP XSSUB, SSUB ;S-S: Sub top two elts, pop, pop, push answer
MAKEOP XSNEG, SNEG ;-S: Negate top elt, pop, push answer
MAKEOP XSMUL, SMUL ;S*S: Mul top two elts, pop, pop, push answer
MAKEOP XSDIV, SDIV ;S/S: Div top two elts, pop, pop, push answer
MAKEOP XSEXP,SEXP ;S↑S: Raise scalar to a power
MAKEOP XSABS,SABS ;|S|: Absolute value of a scalar
MAKEOP XVMAGN, VMAGN ;S ← norm of vector
MAKEOP XVDOT, VDOT ;S ← vector dot vector
;PVDOT ;S ← vector dot vector all 4 cells
MAKEOP XSSBRTN,SSBRTN,<n> ;S ← SBRTN[n](top scalar elt)
MAKEOP XTMAGN,TMAGN ;S ← extracts angle of rotation from trans
MAKEOP XTAXIS,TAXIS ;V ← extracts axis of rotation from trans
MAKEOP XVMAKE,VMAKE ;V ← vector(scalar,scalar,scalar)
MAKEOP XSVMUL,SVMUL ;V ← scalar * vector
MAKEOP XVSDIV,VSDIV ;V ← vector / scalar
MAKEOP XVADD, VADD ;V ← vector + vector
MAKEOP XVSUB, VSUB ;V ← vector - vector
MAKEOP XUNITV,UNITV ;Vector ← vector / its norm
MAKEOP XVCROSS,CROSV ;Vector ← vector cross vector
MAKEOP XTVMUL,TVMUL ;Vector ← trans * vector
MAKEOP XTPOS,TPOS ;Vector ← translation_part_of_trans
MAKEOP XTORIEN,TORIEN ;T ← rotation_part_of_trans
MAKEOP XVSAXWR,VSAXWR ;T ← rotation(vector,angle)
MAKEOP XTMAKE,TMAKE ;T ← trans(rot,vector)
MAKEOP XTVADD,TVADD ;T ← t + v
MAKEOP XTVSUB,TVSUB ;T ← t - v
;FTOF ;T ← INV(t1) * t2 done by TTMUL(TINVRT(t1),t2) in pcode
MAKEOP XTTMUL,TTMUL ;T ← trans * trans
MAKEOP XTINVRT,TINVRT ;T ← inverse(trans)
MAKEOP XCONSTR,CONSTR ;T ← construct(v,v,v)
MAKEOP XMAX,MAX ;s ← s MAX s
MAKEOP XMIN,MIN ;s ← s MIN s
MAKEOP XIDIV,IDIV ;s ← INT(INT(s)/INT(s))
MAKEOP XMOD,MOD ;s ← s MOD s
;Condition monitors
MAKEOP XCMENBL,CMENBL,<o> ;Enable c-m at level-offset o
MAKEOP XCMDSBL,CMDSBL,<o> ;Disable c-m at level-offset o
MAKEOP XCMTRIG,CMTRIG ;Trigger the c-m body (use only in checker)
MAKEOP XCMSKED,CMSKED,<n> ;Sleep for n mills (use only in checker)
MAKEOP XCMUNCR,CMUNCR ;Start uncritical section
MAKEOP XCMDONE,CMDONE ;Ends force/hardware/duration c-m's, if c-m was
; re-enabled then restarts it, else dismisses it
MAKEOP XCMFORCE,CMFORCE ;Initialize force sensing - vector & level on stack
MAKEOP XCMSENSE,CMSENSE ;Initialize hardware sensing
MAKEOP XCMDUR,CMDUR ;Wait for set time, then start up c-m
MAKEOP XFILL8,NOOP ;filler (for hardware cmons?)
MAKEOP XFILL9,NOOP ;filler (for hardware cmons?)
;Initialization
MAKEOP XPROG,PROG ;Initialize mechanism variables
MAKEOP XENDP,ENDP ;Clean up mechanism variables
;Input/Output
MAKEOP XPROMPT,PROMPT ;Wait for a "P" on VT05 before proceeding
MAKEOP XSCALRD,SCALRD ;Read in a scalar from the terminal
MAKEOP XPRINT,PRINT ;Type an ASCIZ string on the VT05.
MAKEOP XVALPRN,VALPRN ;Type a value, whatever type it is, and pop it.
MAKEOP XVARPRN,VARPRN,<o> ;Type a variable (level-offset), whatever type.
MAKEOP XQUERY,QUERY ;Read in a boolean from the VT05 - either "Y" or "N"
MAKEOP XFIL10,NOOP ;filler
MAKEOP XFIL11,NOOP ;filler
;Debugging aids
MAKEOP XBRACE,BRACE ;Bracepoint in the program (break or trace)
MAKEOP XNOOP,NOOP ;Null operation
MAKEOP XTOPAL,TOPAL ;Escape to PAL
;Temp hacks for debugging force wrist
MAKEOP XSETBAS,SETBAS ;Zero wrist callibration matrix
MAKEOP XWRIST,WRIST,<o> ;Store 6 force components in array o
;following added by MSM to get at new POINTY routines
STSW CPOINTY,0 ; unless otherwise stated this is not a POINTY compilation
.IFNZ CPOINTY
; stack ops producing appropriate orientation
; for the trans/frame on stack
MAKEOP XUPARROW,UPARROW ; ↑ z-axis pointing upward
MAKEOP XDOLLAR,DOLLAR ; $ station orientation, i.e. nilrot
MAKEOP XALPHA,ALPHA ; ⊂ bgrasp orien at bpark, e.e. rot(zhat,180)
MAKEOP XDWNARROW,DWNARROW ; ↓ bpark orien, i.e. rot(yhat,180)
MAKEOP XEVAL,NOOP ;
MAKEOP XWREAD,NOOP ;Wrist reading routine
MAKEOP XPUSHINTI, PUSHINTI,<n> ;like pushsci but argument is an integer
MAKEOP XAGTVAL, AGTVAL,<n,o> ; like gtval except pushes array value
MAKEOP XACHNGE, ACHNGE,<n,o>
MAKEOP XRTVAL, RTVAL,<o> ; returns value of levof in return buffer
MAKEOP XARTVAL, ARTVAL,<n,o> ; like rtval, only for array
;MAKEOP XPMOVE, PMOVE,<a,n> ; pointy move
;MAKEOP XTADRIVE,TADRIVE,<a,n> ; abs drive
;MAKEOP XTDDRIVE,TDDRIVE,<a,n> ; rel drive
MAKEOP XSPLUS,NOOP ; dummy
MAKEOP XVPLUS,NOOP ; dummy
MAKEOP XVNEG,VNEG ; take negative of the top element which is a vector
MAKEOP XVSMUL,VSMUL ; intert top two arguments and call svmul
MAKEOP XWRT,WRT ; v wrt t = orient(t)*v
MAKEOP XVFREL,VFREL ; v rel f = t*v
MAKEOP XFTOF,FTOF ;t1→t2 = inv(t1)*t2
MAKEOP XFFREL,FFREL ; f rel t = t*f
MAKEOP XFCONSTR,FCONSTR ; like constr, but takes three frames instead
MAKEOP XSQRT,PSQRT
MAKEOP XSIN,PSIN
MAKEOP XCOS,PCOS
MAKEOP XTAN,PTAN
MAKEOP XASIN,PASIN
MAKEOP XACOS,PACOS
MAKEOP XATAN2,PATAN2
MAKEOP XLOG,PLOG
MAKEOP XEXP,PEXP
MAKEOP XPDONE,PDONE ; use instead of terminate
MAKEOP XGTBLK,GTBLK,<n,<t>,r>
MAKEOP XRJMP,RJMP,<r> ; like JUMP but relative offset
MAKEOP XRJMPC,RJMPC,<r> ; like JUMPC but relative offset
MAKEOP XRFRCHK,RFRCHK,<r> ; like FORCHK but relative offset
MAKEOP XRPRINT,RPRINT,<r> ; like PRINT, but relative offset
MAKEOP XRPMOVE,RPMOVE,<r,n> ; pointy move
MAKEOP XRTADRIVE,RTADRIVE,<r,n> ; abs drive
MAKEOP XRTDDRIVE,RTDDRIVE,<r,n> ; rel drive
MAKEOP XRCENTER,RCENTER,<r,n> ;center
MAKEOP XGATHER,GATHER,<n,n> ;turn data gather on
MAKEOP XRFORCE,RFORCE ;gather raw force data
MAKEOP XDISVT05,DISVT05,<n> ;turn on and off the joint angle display
.ENDC